import { useAppBreakpoints } from '@peng_kai/theme/vue/composables/useAppBreakpoints';

export function useBreakpointPage(pages: Record<'small' | 'other', Parameters<typeof defineAsyncComponent>[0]>) {
  const bp = useAppBreakpoints();

  return computed(() => {
    const loader = bp.ltTablet ? pages.small : pages.other;
    return defineAsyncComponent(loader);
  });
}
